package com.chanyachting.emall.action.companyproduct;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.chanyachting.emall.domain.Dock;
import com.chanyachting.emall.form.DockForm;
import com.chanyachting.emall.service.DockyachtService;
import com.chanyachting.emall.serviceImpl.DockyachtServiceImpl;

public class EditDockAction extends Action {
	
	
	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		
		
		DockForm dockForm=(DockForm)form;
		
		Dock dock = null;
		try {
			
			DockyachtService cpservice=new DockyachtServiceImpl();
			
			dock = cpservice.QueryOneDock(dockForm.getId().toString());
			
		} catch (Exception e) {
			
			e.printStackTrace();
		}
		dockForm.setDock(dock);
		
		return mapping.findForward("editDock");
	}
	

}
